package com.iodemo;

import java.io.*;

public class BufferWirteTest {
    public static void main(String[] args) {
        OutputStream os = null;
        OutputStreamWriter osw = null;
        BufferedWriter bw = null;

        try {
            os = new FileOutputStream("/Users/edy/Desktop/file/1.txt",true);
            osw = new OutputStreamWriter(os,"UTF-8");
            bw = new BufferedWriter(osw);
            bw.write("我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人");
            bw.flush();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUntilsDemo.close(bw);
            IOUntilsDemo.close(osw);
            IOUntilsDemo.close(os);

        }
    }
}
